#------------------------------------------------------------------------------
# papa
cmake_minimum_required(VERSION 2.6)

project(papa)

if (WIN32)
add_definitions(-D__WINDOWS__)
add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-W3)
else()
add_definitions(-Wall)
    if (CMAKE_COMPILER_IS_GNUCXX)
        add_definitions(-std=gnu++0x)
    else ()
        add_definitions(-std=stdc++11)
    endif()
endif()

include_directories(
	${PROJECT_SOURCE_DIR}
)

set(papa_SRC
	papa/base.h
	papa/platform.h
	papa/application.h
	papa/thread/lock_guard.h
	papa/thread/mutex.h
	papa/thread/thread.h
	papa/thread/thread_runnable.h
	papa/net/io_runnable.h
	papa/net/socket_event_handler_factory.h
	papa/net/socket_event_handler.h
	papa/net/tcp_server.h
	papa/net/tcp_socket.h
    papa/net/http_backend.h
    papa/util/string.h
    papa/util/time.h
    papa/util/xml_file.h
    papa/util/logger.h

	src/application.cc
	src/thread/mutex.cc
	src/thread/thread.cc
	src/net/io_runnable.cc
	src/net/tcp_server.cc
	src/net/tcp_socket.cc
    src/net/http_backend.cc
    src/util/string.cc
    src/util/time.cc
    src/util/xml_file.cc
    src/util/logger.cc
)

add_library(papa STATIC ${papa_SRC})